Nondecreasing sequence determining device, method and program

ABSTRACT

Determination as to whether a nondecreasing sequence exists or not is efficiently made. A sorting part sorts elements of a set Pi in ascending order to generate vectors ti,i+1 and bi,i+1. A merging part generates vectors t0,m and b0,m by repeating the process of merging vectors (ti,j, bi,j) and (tj,k, bj,k) to generate (ti,k, bi,k). A stable-sorting part generates a vector e by coupling and stably sorting vectors bi,j and tj,k. A searching part searches for sets of (λ, x, y) in which e[λ] is bi,j[x] and e[λ+1] is tj,k[y] and generates a set X including all x and a set Y including all y. An extracting part sorts ti,j[x] (x∈X) in ascending order to generate a vector ti,k and sorts bj,k[y] (y∈Y) in ascending order to generate a vector bi,k. If the length of a vector t0,m is 0, a determining part outputs a result of determination that indicates the absence of a nondecreasing sequence.

TECHNICAL FIELD

The present invention relates to an applied cipher technique and, inparticular, to a method for determining whether a nondecreasing sequenceexists without revealing input data.

BACKGROUND ART

There is a method, called secure computation, for obtainingcomputational results without decrypting encrypted numerical values (seeNon-patent literature 1, for example). In the method in Non-patentLiterature 1, encryption is performed that distributes pieces of anumerical value are distributed among three secure computers and thethree secure computers cooperate to perform a computation, therebyenabling the result of an addition, subtraction, addition by a constant,multiplication, multiplication by a constant, or logical operation(negation, AND, OR, or exclusive-OR) or data format conversion (integer,binary) to be held in such a manner that the result is distributed amongthe three secure computers without reconstructing the numerical value,that is, with the result being kept encrypted.

One method of accomplishing pattern matching of character sequences onsecure computation is a method described in Non-patent literature 2. Inthe method in Non-patent literature 2, pattern matching is accomplishedby evaluating a nondeterministic finite automaton represented by apattern character by character in an input text.

PRIOR ART LITERATURE Non-Patent Literature

-   Non-patent literature 1: Koji Chida, Koki Hamada, Dai Ikarashi,    Katsumi Takahashi: “A three-party secure function evaluation with    lightweight verifiability revisited”, CSS, 2010-   Non-patent literature 2: Hiroki Harada, Hirohito Sasakawa, Hiroki    Arimura, Jun Sakuma, “A Polynomial Time/Space Algorithm for    Oblivious Regular Expression Matching Algorithm”, SCIS, pp. 1-8,    2014

SUMMARY OF THE INVENTION Problems to be Solved by the Invention

However, the existing technique in Non-patent literature 2 requires Ω(n)rounds of multiplications, where n is the length of an input text inpattern matching. A process for determining whether a text matches apattern after positions of partial character strings in the pattern areidentified in pattern matching can be abstracted to the problem ofdetermining whether a nondecreasing sequence can be created by selectingelements one by one from each set of a sequence of sets.

An object of the present invention is to efficiently determine whether anondecreasing sequence exists by selecting elements one by one from eachset of a sequence of sets.

Means to Solve the Problem

To solve the problem described above, a nondecreasing sequencedetermining device according to the present invention comprises: asorting part taking inputs of m sets P₀, . . . , P_(m-1) and sortingelements of a set P_(i) in ascending order for i=0, . . . , m−1 togenerate a vector t_(i,i+1) and a vector b_(i,i+1); a merging partmerging vectors t_(0,1), . . . , t_(m-1,m) to generate a vector t_(0,m)and merging vectors b_(0,1), . . . , b_(m-1,m) to generate a vectorb_(0,m) by repeating a process of merging vectors (t_(i,j), b_(i,j)) andvectors (t_(j,k), b_(i,k)) that satisfy 0≤i<j<k≤m to generate vectors(t_(j,k), b_(j,k)); and a determining part outputting a result ofdetermination that indicates the absence of a nondecreasing sequence ifthe length of the vector t_(0,m) is 0 and outputting a result ofdetermination that indicates the presence of a nondecreasing sequence ifthe length of the vector t_(0,m) is greater than or equal to 1. Themerging part comprises: a stable-sorting part coupling a vector b_(i,j)with a vector t_(j,k) and stably sorting elements of a resulting vectorto generate a vector e; a searching part searching the vector e forevery set of (λ, x, y) in which e[λ] is b_(i,j)[x] and e[λ+1] ist_(j,k)[y] and generating a set X including all of found x and a set Yincluding all of found y; and an extracting part sorting elementst_(i,j)[x] (x∈X) of a vector t_(i,j) in ascending order to generate avector t_(i,k) and sorting elements b_(j,k)[y] (y∈Y) of a vector b_(j,k)in ascending order to generate a vector b_(i,k).

Effects of the Invention

The nondecreasing sequence determining technique according to thepresent invention determines in O(log m) rounds whether a nondecreasingsequence exists by selecting elements one by one from each of m sets.Accordingly, whether a nondecreasing sequence exists can be efficientlydetermined. This enables efficient pattern matching for texts.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating a functional configuration of anondecreasing sequence determining device according to a firstembodiment;

FIG. 2 is a diagram illustrating a process flow of a nondecreasingsequence determining method according to the first embodiment;

FIG. 3 is a diagram illustrating a functional configuration of anondecreasing sequence determining device according to a thirdembodiment; and

FIG. 4 is a diagram illustrating a process flow of a nondecreasingsequence determining method according to the third embodiment.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Before describing embodiments, notation and the definitions of termsused herein will be given.

Notation

A value “a” concealed by encryption or secret sharing is referred to asa secret text of “a” and denoted as <a>. If secret sharing is used forconcealment, a set of pieces of a shared secret held by secure computingdevices is referred to by <a>.

The i-th row of a matrix X is denoted by X[i]. The i-th element of avector u is denoted by u[i]. A whole matrix of resulting from concealingthe elements of a matrix X is denoted by <X> and is referred to as asecret text of X. A whole vector resulting from concealing the elementsof a vector “u” is denoted by <u> and referred to as a secret text of“u”.┌●┐  [Formula 1]is the ceiling function and means the smallest integer greater than orequal to ●.└●┘  [Formula 2]is the floor function and means the greatest integer smaller than orequal to ●.

●^(T) denotes the transpose of ●.

<Addition, Subtraction, Multiplication>

Addition, subtraction and multiplication take inputs of secret texts<a>, <b> of two values a, b and yield secret texts <c₁>, <c₂> and <c₃>,respectively, as the results of the computations, a+b, a−b, and ab,respectively. The executions of the operations are written as follows:<c ₁>←Add(<a>,<b>),<c ₂>←Sub(<a>,<b>),<c ₃>←Mul(<a>,<b>)  [Formula 3]

Note that when there is no risk of misunderstanding, Add (<a>, <b>), Sub(<a>, <b>) and Mul (<a>, <b>) are simply denoted as <a>+<b>, <a>−<b> and<a>×<b>, respectively.

<Logical Operations>

Logical OR, logical AND, and negation operations take inputs of secrettexts <a>, <b> of two values a, b∈{0, 1} and yield secret texts <c₁>,<c₂> and <c₃>, respectively, of the results c₁, c₂, and c₃ of logical ORof “a” and “b”, logical AND of “a” and “b” and negation of “a”,respectively. The executions of the operations are written as follows:<c ₁ >←<a>

<b>,<c ₂ >←<a>

<b>,<c ₃ <←

<a>  [Formula 4]

The logical operations are accomplished by computations of the followingformulas:<c ₁ >←<a>+<b>−<a>×<b>,<c ₂ >←<a>×<b>,<c ₃>←1−<a>  [Formula 5]

<Sort Operation>

Sort is an operation that sorts elements of a vector in ascending orderand outputs the resulting vector. The vector k′=(k′[0], . . . , k′[n−1])output for an input vector k=(k[0], . . . , k[n−1]) is a vectorresulting from sorting of the elements of k that satisfy k′[0]≤ . . .≤k′[n−1].

Stable sort is an operation which preserves the original order ofelements having the same value, if present, in the sort operation.Elements of vectors k and k′ satisfy k′[π_(s)(i)]=k[i] for a givenbijection π_(s){0, . . . , n−1}→{0, . . . , n−1} and the followingformula holds in the stable sort.π_(s)(i)<π_(s)(j)

(k[i]<k[j])

(k[i]=k[j]

i<j)  [Formula 6]

A stable sort operation in secret computation dealt with in thefollowing description takes inputs of a plurality of vectors and, inaccordance with sorting of the elements of a vector used as a key, sortsthe elements of another vector. Specifically, a stable sort operationtakes inputs of a vector k having a size n used as the key in the stablesort and secret texts <k>, <a⁽⁰⁾>, . . . , <a^((λ−1))> of a number λ,(1≤λ) of vectors a⁽⁰⁾, . . . , a^((λ−1)) having the size n andcalculates secret texts <b⁽⁰⁾>, . . . , <b^((λ−1))> of vectors b⁽⁰⁾, . .. , b^((λ−1)) in which the elements of each vector a⁽⁰⁾, . . . ,a^((λ−1)) are sorted in accordance with the order of the elements of thevector k sorted by the stable sort.<b ⁽⁰⁾ >, . . . ,<b ^((λ−1))>←StableSort(<a ⁽⁰⁾ >, . . . ,<a ^((λ−1))>;<k>)  [Formula 7]

Key reveal sort is processing in which a key is revealed in a stablesort operation. The processing is more efficient than processingperformed with the key being concealed and, if the configuration ofvalues included in the key is known, there is no risk of unnecessarilyrevealing information. The execution of the operation is written asfollows.<b ⁽⁰⁾ >, . . . ,<b ^((λ−1))>←RevealSort(<a ⁽⁰⁾ >, . . . ,<a ^((λ−1))>;<k>)  [Formula 8]

Concealment, reconstruction, addition, subtraction and multiplicationmay be accomplished by using methods described in Non-PatentLiterature 1. Stable sort and key reveal sort may be accomplished byusing a method described in Koki Hamada, Dai Ikarashi, Koji Chida, andKatsumi Takahashi, “Oblivious radix sort: An efficient sorting algorithmfor practical secure multi-party computation”, IACR Cryptology ePrintArchive, vol. 2014, p. 121, 2014 (Reference literature 1)”.

<Nondecreasing Sequences>

The nondecreasing sequence determining technique is a method fordetermining whether a vector p that is a nondecreasing sequence having asize m form sets P₀, P₁, . . . , P_(m-1) (where p[i]∈P_(i)(0≤i<m) andp[0]≤p[1]≤ . . . ≤p[m−1]).

For example, assume that sets P₀, P₁, . . . , P₄ are as follows.

P₀={0, 3, 7, 8, 10}

P₁={2, 5, 8, 9}

P₂={2, 4, 8}

P₃={0, 4, 7, 9}

P₄={0, 6, 7}

For example, the vector P₀={0, 8, 2, 4, 6} satisfies p₀[i]∈P_(i)(0≤i<m)but does not satisfy p₀[0]≤p₀[1]≤p₀[2]≤p₀[3]≤p₀[4] because p₀[1]>p₀[2],and therefore the vector p₀ is not a nondecreasing sequence.

On the other hand, for example, the vector p₁=(0, 2, 4, 4, 6) satisfiesp₁[i]∈P_(i)(0≤i<m) and also satisfies p₁[0]≤p₁[1]≤p₁[2]≤p₁[3]≤p₁[4] andtherefore the vector p₁ is a nondecreasing sequence.

Embodiments of the present invention will be described below in detail.Note that components that has like functions are given like referencenumerals in drawings and repeated description of the components will beomitted.

First Embodiment

As illustrated in FIG. 1, a nondecreasing sequence determining device 1according to a first embodiment comprises a sorting part 10, a mergingpart 20 and a determining part 30. The merging part 20 comprises astable-sorting part 21, a searching part 22 and an extracting part 23,for example.

The nondecreasing sequence determining device 1 is a special deviceconfigured by installing a special program into a well-known ordedicated computer comprising a central processing unit (CPU), a randomaccess memory (RAM) and other components. The nondecreasing sequencedetermining device 1 executes processes under the control of the CPU,for example. Data input into the nondecreasing sequence determiningdevice 1 and data obtained through the processes are stored in the RAMand the data stored in the RAM is read and used in other processes asneeded, for example.

A nondecreasing sequence determining method according to the firstembodiment will be described below with reference to FIG. 2.

The nondecreasing sequence determining method according to the firstembodiment takes inputs of m sets P₀, . . . , P_(m-1) and returns 1 if avector p that is a nondecreasing sequence having a size m exists orreturns 0 if not.

At step S10, the sorting part 10 sorts the elements of a set P_(i),where i=0, . . . , m−1, in ascending order to generate vectors t_(i,i+1)and b_(i,i+1). Specifically, the sorting part 10 sorts the elements of aset P₀ in ascending order to generate vectors t_(0,1) and b_(0,1), sortsthe elements of a set P₁ in ascending order to generate vectors t_(1,2)and b_(1,2), and sorts the elements of a set P_(m-1) in ascending orderto generate vectors t_(m-1,m) and b_(m-1,m).

At step S20 a, the merging part 20 selects vectors (t_(i,j), b_(i,j))and (t_(j,k), b_(j,k)), merges the vectors (t_(i,j), b_(i,j)) and(t_(j,k), b_(j,k)) by a process from step S21 to step S23 to generatevectors (t_(i,k), b_(i,k)). By recursively performing the process, themerging part 20 merges vectors t_(0,1), . . . , t_(m-1), . . . ,t_(m-1,m) to generate a vector t_(0,m) and merges vectors b_(0,1), . . ., b_(m-1,m) to generate a vector b_(0,m).

At step S21, the stable-sorting part 21 couples the vector b_(i,j) andvector t_(j,k) together and stably sorts the elements in ascending orderto generate a vector e.

At step S22, the searching part 22 searches the vector e for every set(λ, x, y) in which e[λ] is b_(i,j)[x] and e[λ+1] is t_(j,k)[y] andgenerates a set X that includes all of found x and a set Y that includesall of found y.

At step S23, the extracting part 23 sorts t_(i,j)[x] (x∈X) in ascendingorder to generate a vector t_(i,k) and sorts b_(j,k)[y] (y∈Y) togenerate a vector b_(i,k).

At step S20 b, the merging part 20 determines whether all of the vectorst_(0,1), . . . , t_(m-1,m) and vectors b_(0,1), . . . , b_(m-1,m) havebeen merged. In other words, the merging part 20 determines whethervectors (t_(0,m,) b_(0,m)) have been generated. If the merge has notbeen completed, the process returns to step S20 a. If merge has beencompleted, the process proceeds to step S30.

At step S30, if the length of a vector t_(0,m) is 0, the determiningpart 30 outputs 0 indicating the absence of a nondecreasing sequence. Ifthe length of a vector t_(0,m) is greater than or equal to 1, thedetermining part 30 outputs 1 indicating the presence of a nondecreasingsequence.

An example will be used to show that the presence of a nondecreasingsequence can be determined by the method described above.

Assume that sets P₀, P₁, . . . , P₄ are as follows.

P₀−{0, 3, 7, 8, 10}

P₁={2, 5, 8, 9}

P₂={2, 4, 8}

P₃={0, 4, 7, 9}

P₄={0, 6, 7}

Since a nondecreasing sequence is p[i]∈P_(i)(0≤i<m) andp_(i)[0]≤p₁[1]≤p₁[2]≤p₁[3]≤p₁[4], there are nondecreasing sequences suchas (0, 2, 2, 4, 6), (0, 2, 2, 4, 7), (0, 2, 4, 4, 6), (0, 2, 4, 4, 7)and (0, 2, 4, 7, 7), for example, in sets P₀, P₁, . . . , P₄.

At step S10, the following vectors t_(0,1), . . . , t_(4,5) and b_(0,1),. . . , b_(4,5) are generated.

t_(0,1)=b_(0,1)=(0, 3, 7, 8, 10)

t_(1,2)=b_(1,2)=(2, 5, 8, 9)

t_(2,3)=b_(2,3)=(2, 4, 8)

t_(3,4)=b_(3,4)=(0, 4, 7, 9)

t_(4,5)=b_(3,4)=(0, 6, 7)

At step S20 a, i=0, j=1, and k=2 are set and vectors (t_(0,1), b_(0,1))and (t_(1,2), b,_(1,2)) are selected and merged by performing steps S21to S23 described below to generate vectors (t_(0,2), b_(0,2)).

At step 21, the following vector e is generated from the vectors b_(0,1)and t_(1,2).

e=(0, 2, 3, 5, 7, 8, 8, 9, 10)

=(b_(0,1)[0], t_(1,2)[0], b_(0,1)[1], t_(1,2)[1], b_(0,1)[2],b_(0,1)[3], t_(1,2)[2], t_(1,2)[3], b_(0,1)[4])

At step S22, the following sets of (λ, x, y) are found.

(λ=0,x=0,y=0),

(λ=2,x=1,y=1),

(λ=5,x=3,y=2)

Therefore, set λ={0, 1, 31} and set Y={0, 1, 2}.

At step S23, the following vectors (t_(0,2), b_(0,2)) are generated.

t_(0,2)=(t_(0,1)[0], t_(0,1)[1], t_(0,1)[3])=(0, 3, 8)

b_(0,2)=(b_(1,2)[0], b_(1,2)[1], b_(1,2)[2])=(2, 5, 8)

At step S20 b, vectors t_(0,5) and b_(0,5) do not exist and thereforethe process returns to step S20 a.

In the second round of step S20 a, i−2, j−3 and k−4 are set, vectors(t_(2,3), b_(2,3)) and (t_(3,4), b_(3,4)) are selected and mergedvectors (t_(2,4), b,_(2,4)) are generated in the same way as describedabove.

The vector b_(2,3)=(2, 4, 8) and the vector t_(3,4)=(0, 4, 7, 9) arecoupled together and stable sort is performed to generate the followingvector e.

e=(0, 2, 4, 4, 7, 8 9)

=(t_(3,4)[0], b_(2,3)[0], b_(2,3)[1], t_(3,4)[1], t_(3,4)[2],b_(2,3)[2], t_(3,4)[3])

Then, (λ=2,x=1,y=1) and (λ=5,x=2,y=3) are found and therefore X=(1,2)and Y=(1, 3). Accordingly, the vectors (t_(2,4), b_(2,4)) are asfollows.

t_(2,4)=(t_(2,3)[1], t_(2,3)[2])=(4, 8)

b_(2,4)=(b_(3,4)[1], b_(3,4)[3])=(4, 9)

In the third round of step S20 a, i=2, j=4 and k=5 are set, vectors(t_(2,4), b_(2,4)) and (t_(4,5), b_(4,5)) are selected and mergedvectors (t_(2,5), b_(2,5)) is generated in the same way as describedabove.

The vector b_(2,4)−(4, 9) and the vector t_(4,5)−(0, 6, 7) are coupledtogether and stable sort is performed to generate the following vectore.

e=(0, 4, 6, 7, 9)

=(t_(4,5)[0], b_(2,4)[0], t_(4,5)[1], t_(4,5)[2], b_(2,4)[1])

Then, (λ=1, x=0, y=1) is found and therefore X=(0) and Y=(1).Accordingly, the vectors (t_(2,5), b_(2,5)) are as follows.

t_(2,5)=(t_(2,4)[0])=(4)

b_(2,5)=(b_(4,5)[1])=(6)

In the fourth round of step S20 a, i=0, j=2 and k=5 are set, vectors(t_(0,2), b_(0,2)) and (t_(2,5), b_(2,5)) are selected and mergedvectors (t_(0,5), b_(0,5)) are generated in the same way as describedabove.

The vector b_(0,2)=(2, 5, 8) and the vector t_(2,5)=(4) are coupledtogether and stable sort is performed to generate the following vectore.

e=(2, 4, 5, 8)

=(b_(0,2)[0], t_(2,5)[0], b_(0,2)[1], b_(0,2)[2])

Then, (λ=0, x=0, y=0) is found and therefore X=(0) and Y=(0).Accordingly, the vector (t_(0,5), b_(0,5)) is as follows.

t_(0,5)=(t_(0,2)[0])=(0)

b_(0,5)=(b_(2,5)[0])=(6)

At step S20 b, since vectors t_(0,5) and b_(0,5) exist, the processproceeds to step S30.

At step S30, since the length of t_(0,5) is not 0, 1 indicating thepresence of a nondecreasing sequence is output as the result ofdetermination.

Second Embodiment

In a nondecreasing sequence determining device according to a secondembodiment, a merging part 20 sets i, j, and k such that the followingformula is satisfied, and vectors (t_(i,j), b_(i,j)) and vectors(t_(i,k), b_(i,k)) are selected for generating vectors (t_(i,k),b_(i,k)).

$\begin{matrix}{j = \left\lfloor \frac{i + k}{2} \right\rfloor} & \left\lbrack {{Formula}\mspace{14mu} 9} \right\rbrack\end{matrix}$

By configuring as described above, the merging part 20 can obtainvectors (t_(0,m), b_(0,m)) with a recursive procedure in┌log₂ m┐  [Formula 10]rounds.

Third Embodiment

A third embodiment is a method of determining whether a nondecreasingsequence exists by using secure computation. In the third embodiment,each iteration of a recursive procedure can be accomplished in O(1)rounds of computations and therefore the whole process can beaccomplished in O(log m) rounds.

As illustrated in FIG. 3, a nondecreasing sequence determining device 2according to the third embodiment comprises a sorting part 10, aconcealing part 40, a merging part 50, and a determining part 60. Themerging part 50 comprises a first stable-sorting part 51, a firstkey-reveal-sorting part 52, a second stable-sorting part 53 and a secondkey-reveal-sorting part 54, for example.

A nondecreasing sequence determining method according to the thirdembodiment will be described below with reference to FIG. 4. Thefollowing description focuses on differences from the first embodimentdescribed above.

At step S40, the concealing part 40 determines that each of the elementsof a set P_(i), where i=0, . . . , m−1, is greater than or equal to 0and less than n, and converts a vector to a vector to generate anencrypted text <t′_(i,i+1)> in which the vector t_(i,i,+1) is concealedin accordance with the following formula.

$\begin{matrix}{{t_{i,{i + 1}}^{\prime}\lbrack k\rbrack} = \left\{ \begin{matrix}1 & {{{{if}\mspace{14mu}{\exists{\lambda\mspace{14mu}{s.t.\;{t_{i,{i + 1}}\lbrack\lambda\rbrack}}}}} = k},} \\0 & {otherwise}\end{matrix} \right.} & \left\lbrack {{Formula}\mspace{14mu} 11} \right\rbrack\end{matrix}$

Similarly, the concealing part 40 converts a vector b_(i,i+1) to avector b′_(i,i+1) to generate an encrypted text <b′_(i,i+1)> in whichthe vector b_(i,i,+1) is concealed in accordance with the followingformula.

$\begin{matrix}{{b_{i,{i + 1}}^{\prime}\lbrack k\rbrack} = \left\{ \begin{matrix}1 & {{{{if}\mspace{14mu}{\exists{\lambda\mspace{14mu}{s.t.\;{b_{i,{i + 1}}\lbrack\lambda\rbrack}}}}} = k},} \\0 & {otherwise}\end{matrix} \right.} & \left\lbrack {{Formula}\mspace{14mu} 12} \right\rbrack\end{matrix}$

Examples of vectors t′_(i,i,+1) and b′_(i,i+1) are given below. Forexample, assume that sets P₀, P₁, . . . , P₄ are as follows.

P₀={0, 3, 7, 8, 10}

P₁={2, 5, 8, 9}

P₂={2, 4, 8}

P₃={0, 4, 7, 9}

P₄={0, 6, 7}

Let n=12, then vectors t′_(i,i,+1) and by b′_(i,i,+1) are as follows.

t′_(0,1)=b′_(0,1)=(1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0),

t′_(1,2)=b′_(1,2)=(0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0),

t′_(2,3)=b′_(2,3)=(0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0),

t′_(3,4)=b′_(3,4)=(1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0),

t′_(4,5)=b′_(4,5)=(1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0)

At step S50 a, the merging part 50 selects a secret text (<t′_(i,j)>,<b_(i,j)>) and a secret text (<t′_(j,k)>, <b′_(j,k)>) that satisfy0≤i<j<k≤m and merges the secret text (<t′_(i,j)>, <b′_(i,j)) and thesecret text (<t′_(j,k)>, <b′_(j,k)>) together by the process from stepS51 to step S54 to generate a secret text (<t′_(j,k)>, <b′_(j,k)>). Byrecursively performing the process, the merging part 50 merges secrettexts <t′_(0,1)>, . . . , <t′_(m-1,m)> to generate a secret text<t′_(0,m)> and merges secret texts <b′_(0,1)>, . . . , <b′_(m-1,m)> togenerate a secret text <b′_(0,m)>.

At step S51, the first stable-sorting part 51 alternately arrangeselements of a secret text <b′_(i,j)> and elements of secret text<t′_(j,k)> to generate a secret text <a>. Specifically, the firststable-sorting part 51 generates a secret text <a> for h=0, . . . , n−1in accordance with the following formula.<a[2h]>←<b′ _(i,j)[2h]>,<a[2h+1]>←<t′ _(j,k)[2h+1]>  [Formula 13]

The first stable-sorting part 51 then generates a secret text (<f′>,<a′>, <p>) by stably sorting (<(0, 1)^(n)>, <a>, <(0, . . . , 2n−1)>)using

<a> as a key, where (0, 1)^(n) is a vector that is composed of 0s and 1sand has a length of 2n. Specifically, the stable-sorting part 51performs stable sort written as follows.

$\begin{matrix}{{\left. {\left. \left( {\left\langle f^{\prime} \right\rangle,\left\langle a^{\prime} \right\rangle,\left\langle p \right\rangle} \right)\leftarrow{{StableSort}\left( \left\langle {0,1} \right)^{n} \right\rangle} \right.,\left\langle a \right\rangle,{\left\langle \left( {0,\ldots\;,{{2n} - 1}} \right) \right\rangle;{⫬ \left\langle a \right\rangle}}} \right)\mspace{14mu}{where}\mspace{14mu}\left( {0,1} \right)^{n}} = \overset{\overset{2n}{︷}}{\left( {{0,1,0,1},\ldots\;,{0,1}} \right)}} & \left\lbrack {{Formula}\mspace{14mu} 14} \right\rbrack\end{matrix}$

At step S52, the first key-reveal-sorting part 52 generates a secrettext <m> for h=0, . . . , n−1 in accordance with the following formula.<m[h]>←<a[h]>×(

<f′[h]>×<f′[h+1]>+<f′[h]>×

<f′[h−1]>)  [Formula 15]

The first key-reveal-sorting part 52 then generates a secret text <m′>by key-reveal sorting the secret text <m> using a secret text <p> as akey. Specifically, the first key-reveal-sorting part 52 performskey-reveal sort written as follows.<m′>←RevealSort(<m>;<p>)  [Formula 16]

At step S53, the second stable-sorting part 53 alternately breaks downthe elements of the secret text <m′> to generate secret texts <m₀>,<m₁>. Specifically, the second stable-sorting part 53 generates secrettexts <m₀>, <m₁> for h=0, . . . , n−1 in accordance with the followingformula.<m ₀[h]>←<m′[2h]>,<m ₁[h]>←<m′[2h+1]>  [Formula 17]

The second stable-sorting part 53 then generates a secret text (<t″₀>,<p₀>) by stably sorting (<t′_(i,j)>, <(0, . . . , n−1)]> using

<t′_(i, j)> as a key, generates a secret text <m″₀> by stably sortingthe secret text <m₀> using

<b′_(i,j)> as a key, generates a secret text (<b″₁>, <p₁>) by stablysorting (<b′_(j,k)>, <(0, . . . , n−1)>) using

<b′_(j,k)> as a key, and generates a secret text <m″₁> by stably sortingthe secret text <m₁> using

<t′_(j,k)> as a key. Specifically, the second stable-sorting part 53performs the four stable sort operations given below.(<t″ ₀ >,<p ₀>)←StableSort(<t′ _(i,j)>,<(0, . . . ,n−1)>;

<t′ _(i,j)>),<m″ ₀>←StableSort(<m ₀ >;

b′ _(i,j)>),(<b″ ₁ >,<p ₁>)←StableSort(<b′ _(j,k)>,<(0, . . . ,n−1)>;

<b′ _(j,k)>),<m″ ₁>←StableSort(<m ₁ >;

<t′ _(j,k)>)  [Formula 18]

At step S54, the second key-reveal-sorting part 54 generates secrettexts <t″>, <b″> in accordance with the following formula.<t″>←<t″ ₀ >×<m″ ₀>,<b″>←<b″ ₁ >×<m″ ₁>  [Formula 19]

The second key-reveal-sorting part 54 then generates a secret text<t′_(j,k)> by key-reveal sorting the secret text <t″> using a secrettext <p₀> as a key and generates a secret text <b′_(j,k)> by key revealsorting the secret text <b″> using a secret text <p₁> as a key.Specifically, the second key-reveal-sorting part 54 performs the two keyreveal sort operations given below.<t′>←RevealSort(<t″>;<p ₀>),<b′>←RevealSort(<b″>;<p ₁>)  [Formula 20]

At step S50 b, the merging part 50 determines whether all of the secrettexts <t′_(0,1)>, . . . , <t′_(m-1,m)> and the secret texts <b′_(0,1)>,. . . , <b′_(m-1,m)> have been merged. In other words, the merging part50 determines whether secret texts (<t′_(0,m)>, <b′_(0,m)>) have beengenerated. If the merge has not been completed, the process returns tostep S50 a. If the merge has been completed, the process proceeds tostep S60.

At step S60, the determining part 60 computes <t′_(0,m)[0]>

<t′_(0,m)[1]>

. . .

<t′_(0,m)[m−1]> by using the secret text <t′_(0,m)> and outputs theresult as the result of the determination.

The idea of the second embodiment described previously may be applied tothe merging part 50 of the third embodiment and the merging part 50 maybe configured to set i, j and k so as to satisfy the formula given belowand select a secret text (<t′_(i,j)>, <b′_(i,j)>) and a secret text(<t′_(i,k)>, <b′_(j,k)>).

$\begin{matrix}{j = \left\lfloor \frac{i + k}{2} \right\rfloor} & \left\lbrack {{Formula}\mspace{14mu} 21} \right\rbrack\end{matrix}$

Effects of the Invention

The nondecreasing sequence determining technique according to thepresent invention determines whether a nondecreasing sequence exists ornot by selecting values one by one from each of m sets in only O(log m)rounds of recursive procedure. Especially when the determinationperformed using secure computation, the whole processing can beaccomplished only O(log m) rounds because each iteration of therecursive procedure can be accomplished in O(1) rounds of computation.

Key Points of the Invention

In the present invention, when determination is made as to whether anondecreasing sequence exits by selecting values one by one from each ofm sets, a set of nondecreasing sequences is recursively constructed bydivide and conquer to determine whether a nondecreasing sequence existsin O(log m) rounds. In the divide and conquer, computations areperformed by keeping only sets of good-natured nondecreasing sequencesthat can be efficiently computed, rather than keeping all nondecreasingsequences, thereby accomplishing merge of sets of nondecreasingsequences by secure computation in O(1) rounds. Consequently, the wholecomputations can be accomplished by O(log m) rounds of securecomputation.

It would be understood that the present invention is not limited to theembodiments described above and modifications can be made withoutdeparting from the spirit of the present invention. The operationsdescribed above may be performed not only in time sequence as is writtenbut also in parallel or individually, depending on the throughput of thedevices that perform the processes or requirements.

[Program and Recording Media]

If the processing functions of the devices described above areimplemented by a computer, processing of the function that each deviceneeds to include is described in a program. The program is executed onthe computer to implement the processing functions described above onthe computer.

The program describing the processing can be recorded on acomputer-readable recording medium. The computer-readable recordingmedium may be any medium such as a magnetic recording device, an opticaldisc, a magneto-optical recording medium, and a semiconductor memory,for example.

The program may be distributed, for example, by selling, transferring,or lending portable recording media on which the program is recorded,such as DVDs or CD-ROMs. The program may be stored on a storage deviceof a server computer and transferred from the server computer to othercomputers over a network, thereby distributing the program.

A computer that executes the program first stores the program recordedon a portable recording medium or the program transferred from a servercomputer into a storage device of the computer. When the computerexecutes the processes, the computer reads the program stored in thestorage device of the computer and executes the processes according tothe read program. In another mode of execution of the program, thecomputer may read the program directly from a portable recording mediumand may execute the processes according to the program or may executethe processes according to the program each time the program istransferred from the server computer to the computer. Alternatively, theprocesses may be executed using a so-called ASP (Application ServiceProvider) service in which the program is not transferred from a servercomputer to the computer but processing functions are implemented onlyby instructions to execute the program and acquisition of the results ofthe execution. It should be noted that the program in this modecomprises information that is made available for use in processing by anelectronic computer and is equivalent to a program (such as data that isnot direct commands to the computer but has the nature of definingprocessing performed by the computer).

While a given program is executed on a computer to configure the presentdevice in this mode, at least part of the processes may be implementedby hardware.

What is claimed is:
 1. A nondecreasing sequence determining devicecomprising: processing circuitry configured to take electronic datainputs of m sets P₀, . . . , P_(m-1) and sorting elements of a set P_(i)in ascending order for i=0, . . . , m−1 to generate a vector t_(i,i+1)and a vector b_(i,i+1); perform a merging process of merging vectorst_(0,1), . . . , t_(m-1,m) to generate a vector t_(0,m) and mergingvectors b_(0,1), . . . , b_(m-1,m) to generate a vector b_(0,m) byrepeating a process of merging vectors (t_(i,j), b_(i,j)) and vectors(t_(j,k), b_(j,k)) that satisfy 0≤i<j<k≤m to generate vectors (t_(i,k),b_(i,k)); and output a result of determination that indicates theabsence of a nondecreasing sequence if the length of the vector t_(0,m)is 0 and output a result of determination that indicates the presence ofa nondecreasing sequence if the length of the vector t_(0,m) is greaterthan or equal to 1; wherein the merging process further comprises:coupling a vector b_(i,j) with a vector t_(j,k) and stably sortingelements of a resulting vector to generate a vector e; searching thevector e for every set of (λ, x, y) in which e[λ] is b_(i,j)[x] ande[λ+1] is t_(j,k)[y] and generating a set X including all of found x anda set Y including all of found y; and sorting elements t_(i,j)[x] (x∈X)of a vector t_(i,j) in ascending order to generate a vector t_(i,k) andsorting elements b_(j,k)[y] (y∈Y) of a vector b_(j,k) in ascending orderto generate a vector b_(i,k), wherein the nondecreasing sequencedetermining device is configured to perform pattern matching bydetermining whether or not the nondecreasing sequence can be createdwhen elements are selected, one by one, from the sets P₀, . . . ,P_(m-1), wherein the indication of the presence of the nondecreasingsequence indicates that the sets P₀, . . . , P_(m-1) include positionswhere the partial character strings included in a pattern appear in anelectronic text.
 2. A nondecreasing sequence determining device,comprising: processing circuitry configured to take electronic datainputs of m sets P₀, . . . , P_(m-1) and sorting elements of a set P_(i)in ascending order for i=0, . . . , m−1 to generate a vector t_(i,i|1)and a vector b_(i,i+1); generate an encrypted text <t′_(i,i+1)> in whicha vector t′_(i,i+1) is concealed and generating an encrypted text<b′_(i,i+1)> in which a vector b′_(i,i+1) is concealed, wherein, in thevector t′_(i,i+1), t′_(i,i,+1)[k]=1 is set if λ that satisfiest_(i,i,+1)[λ]k exists for k=0, n−1 and λ=0, . . . , m−1, otherwise,t′_(i,i,+1)[k]=0 is set, and in the vector b′_(i,i+1), b′_(i,i,+1)[k]=1is set if λ that satisfies b_(i,i,+1)[λ]=k exists, otherwiseb′_(i,i+1)[k]=0 is set, where each of elements of the sets P₀, . . . ,P_(M-1) is greater than 0 or equal to 0 and less than n; perform amerging process of merging secret texts <t′_(0,1)>, . . . , <t′_(m-1,m)>to generate a secret text <t′_(0,m)> and merging secret texts<b′_(0,1)>, . . . , <b′_(m-1,m)> to generate a secret text <b′_(0,m)> byrepeating a process of merging secret texts (<t′_(i,j)>, <b′_(i,j)>) and(<t′_(j,k)>, <b′_(j,k)>) that satisfy 0≤i<j<k≤m to generate a secrettext (<t′_(i,k)>, <b′_(i,k)>); and calculate<t′_(0,m)[0]>∨<t′_(0,m)[1]>∨ . . . ∨<t′_(0,m)[m−1]> by using the secrettext <t′_(0,m)> and output the result of the calculation as the resultof determination; wherein the merging process further comprises:alternately arranging elements of secret texts <b′_(i,j)> and <t′_(j,k)>to generate a secret text <a> and stable-sorting a secret text(<(0,1)^(n)>, <a>, <(0, . . . , 2n−1)>) by using ¬<a> as a key togenerate a secret text (f<f′>, <a′>, <p>); calculating<a[h]>×(¬<f′[h]>×<f′[h+1]>+<f′[h]>×¬<f′[h−1]>) for h=0, . . . , n−1 togenerate a secret text <m> and key-reveal sorting the secret text <m> byusing a secret text <p> to generate a secret text <m′>; alternatelybreaking down elements of the secret text <m> to generate secret texts<m₀> and <m₁>, stably sorting (<t′_(i,j)>, <(0, . . . , n−1)>) by using¬<t′_(i,j)> as a key to generate a secret text (<t″₀>, <p₀>), stablysorting the secret text <m₀> by using ¬<b′_(j,k)> as a key to generate asecret text <m″₀>, stably sorting (<b′_(j,k)>, <(0, . . . , n−1)>) byusing ¬<b′_(j,k)> as a key to generate a secret text (<b″₁>, <p₁>), andstably sorting the secret text <m₁> by using ¬<t′_(j,k)> as a key togenerate a secret text <m″₁>; and generating a secret text <t″> that isthe product of a secret text <t″₀> and a secret text <m″₀>, and a secrettext <b″> that is the product of a secret text <b″₁> and a secret text<m″₁>, key-reveal sorting the secret text <t″> by using a secret text<p₀> as a key to generate a secret text <t′_(i,k)>, and key-revealsorting the secret text <b″> by using a secret text <p₁> as a key togenerate a secret text <b′_(i,k)>, where (0, 1)^(n) is a vector beingcomposed of 0s and 1s and having a length of 2n and ¬● denotes thenegation of ●, wherein the nondecreasing sequence determining device isconfigured to perform pattern matching by determining whether or not anondecreasing sequence can be created when elements are selected, one byone, from the sets P₀, . . . , P_(m-1), wherein an indication of thepresence of the nondecreasing sequence indicates that the sets P₀, . . ., P_(m-1) include positions where the partial character strings includedin a pattern appear in an electronic text.
 3. The nondecreasing sequencedetermining device according to claim 1 or 2, wherein the mergingprocess selects i, j, and k that satisfy the following formula:$\begin{matrix}{j = {\left\lfloor \frac{i + k}{2} \right\rfloor.}} & \left\lbrack {{Formula}\mspace{14mu} 22} \right\rbrack\end{matrix}$
 4. A nondecreasing sequence determining method,implemented by a nondecreasing sequence determining device, comprising:a sorting step of taking, by a sorting part, electronic data inputs of msets P₀, . . . , P_(m-1) and sorting elements of a set P_(i) inascending order for i=0, . . . , m−1 to generate a vector t_(i,i+1) anda vector b_(i,i+1), a merging step of merging, by a merging part,vectors t_(0,1), . . . , t_(m-1,m) to generate a vector t_(0,m) andmerging vectors b_(0,1), . . . , b_(m-1,m) to generate a vector b_(0,m)by repeating a process of merging vectors (t_(i,j), b_(i,j)) and vectors(t_(j,k), b_(j,k)) that satisfy 0≤i<j<k≤m to generate vectors (t_(i,k),b_(i,k)); and a determining step of outputting, by a determining part, aresult of determination that indicates the absence of a nondecreasingsequence if the length of the vector t_(0,m) is 0 and outputting aresult of determination that indicates the presence of a nondecreasingsequence if the length of the vector t_(0,m) is greater than or equal to1; wherein the merging step comprises: a stable-sorting step ofcoupling, by a stable-sorting part, a vector b_(i,j) with a vectort_(j,k) and stably sorting elements of a resulting vector to generate avector e; a searching step of searching, by a searching part, the vectore for every set of (λ, x, y) in which e[λ] is b_(i,j)[x] and e[λ+1] ist_(j,k)[y] and generating a set X including all of found x and a set Yincluding all of found y; and an extracting step of sorting, by anextracting part, elements t_(i,j)[x] (x∈X) of a vector t_(i,j) inascending order to generate a vector t_(i,k) and sorting elementsb_(j,k)[y] (y∈Y) of a vector b_(j,k) in ascending order to generate avector b_(i,k), wherein the nondecreasing sequence determining device isconfigured to perform pattern matching by determining whether or not thenondecreasing sequence can be created when elements are selected, one byone, from the sets P₀, . . . , P_(m-1), wherein the indication of thepresence of the nondecreasing sequence indicates that the sets P₀, . . ., P_(m-1) include positions where the partial character strings includedin a pattern appear in an electronic text.
 5. A nondecreasing sequencedetermining method, implemented by a nondecreasing sequence determiningdevice, comprising: a sorting step of taking, by a sorting part,electronic data inputs of m sets P₀, . . . , P_(m-1) and sortingelements of a set P_(i) in ascending order for i=0, . . . , m−1 togenerate a vector t_(i,i+1) and a vector b_(i,i+1); a concealing step ofgenerating, by a concealing part, an encrypted text <t′_(i,i+1)> inwhich a vector t′_(i,i+1) is concealed and generating an encrypted text<b′_(i,i+1)> in which a vector b′_(i,i+1) is concealed, wherein, in thevector t′_(i,i+1), t′_(i,i+1)[k]=1 is set if λ that satisfiest_(i,i,+1)[λ]k exists for k=0, . . . , n−1 and λ=0, . . . , m−1,otherwise, t′_(i,i,+1)[k]=0 is set, and in the vector b′_(i,i+1),b′_(i,i,+1)[k]=1 is set if λ that satisfies b_(i,i,+1)[λ]=k exists,otherwise b′_(i,i+1)[k]=0 is set, where each of elements of the sets P₀,. . . , P_(M-1) is greater than 0 or equal to 0 and less than n; amerging step of merging, by a merging part, secret texts <t′_(0,1)>, . .. , <t′_(m-1,m)> to generate a secret text <t′_(0,m)> and merging secrettexts <b′_(0,1)>, . . . , <b′_(m-1,m)> to generate a secret text<b′_(0,m)> by repeating a process of merging secret texts (<t′_(i,j)>,<b′_(i,j)>) and (<t′_(j,k)>, <b′_(j,k)>) that satisfy 0≤i<j<k≤m togenerate a secret text (<t′_(i,k)>, <b′_(i,k)>); and a determining stepof calculating, by a determining part, <t′_(0,m)[0]>∨<t′_(0,m)[1]>∨ . .. ∨<t′_(0,m)[m−1]> by using the secret text <t′_(0,m)> and outputtingthe result of the calculation as the result of determination; whereinthe merging step comprises: a first stable-sorting step of alternatelyarranging, by a first stable-sorting part, elements of secret texts<b′_(i,j)> and <t′_(j,k)> to generate a secret text <a> and stablysorting a secret text (<(0,1)^(n)>, <a>, <(0, . . . , 2n−1)>) by using¬<a> as a key to generate a secret text (<f′>, <a′>, <p>); a firstkey-reveal-sorting step of calculating, by a first key-reveal-sortingpart, <a[h]>×(¬<f′[h]>×<f′[h+1]>+<f′[h]>×¬<f′[h−1]>) for h=0, . . . ,n−1 to generate a secret text <m> and key-reveal sorting the secret text<m> by using a secret text <p> to generate a secret text <m′>; a secondstable-sorting step of alternately breaking down, by a secondstable-sorting part, elements of the secret text <m> to generate secrettexts <m₀> and <m₁>, stably sorting (<t′_(i,j)>, <(0, . . . , n−1)> byusing ¬<t′_(i,j)> as a key to generate a secret text (<t″₀>, <p₀>),stably sorting the secret text <m₀> by using ¬<b′_(i,j)> as a key togenerate a secret text <m″₀>, stably sorting (<b′_(i,j)>, <(0, . . . ,n−1)>) by using ¬<b′_(i,j)> as a key to generate a secret text (<b″₁>,<p₁>), and stably sorting the secret text <m₁> by using ¬<t′_(j,k)> as akey to generate a secret text <m″₁>; and a second key-reveal-sortingstep of generating, by a second key-reveal-sorting part, a secret text<t″> that is the product of a secret text <t″₀> and a secret text <m″₀>,and a secret text <b″> that is the product of a secret text <b″₁> and asecret text <m″₁>, key-reveal sorting the secret text <t″> by using asecret text <p₀> as a key to generate a secret text <t′_(i,k)>, andkey-reveal sorting the secret text <b″> by using a secret text <p₁> as akey to generate a secret text <b′_(i,k)>, where (0, 1)^(n) is a vectorbeing composed of 0s and 1s and having a length of 2n and ¬● denotes thenegation of ●, wherein the nondecreasing sequence determining device isconfigured to perform pattern matching by determining whether or not anondecreasing sequence can be created when elements are selected, one byone, from the sets P₀, . . . , P_(m-1), wherein an indication of thepresence of the nondecreasing sequence indicates that the sets P₀, . . ., P_(m-1) include positions where the partial character strings includedin a pattern appear in an electronic text.
 6. The nondecreasing sequencedetermining method according to claim 4 or 5, wherein the merging stepselects i, j, and k that satisfy the following equation: $\begin{matrix}{j = {\left\lfloor \frac{i + k}{2} \right\rfloor.}} & \left\lbrack {{Formula}\mspace{14mu} 23} \right\rbrack\end{matrix}$
 7. A non-transitory computer readable medium includingcomputer executable instructions that make a computer function as thenondecreasing sequence determining device according to claim 1 or
 2. 8.A non-transitory computer readable medium including computer executableinstructions that make a computer function as the nondecreasing sequencedetermining device according to claim 3.